import { base } from '@/config'
import http from '@/utils/request'

// 系统消息
const message = {
  // 添加
  add: params => {
    return http.postJson(`${base.message}/base/noticeMsgManager/add`, params)
  },
  // 删除
  delete: id => {
    return http.post(`${base.message}/base/noticeMsgManager/delete/${id}`)
  },
  // 全部删除
  deleteAll: () => {
    return http.post(`${base.message}/base/noticeMsgManager/deleteAll`)
  },
  // 批量删除
  deleteBatch: params => {
    return http.postJson(`${base.message}/base/noticeMsgManager/deleteBatch`, params)
  },
  // 详情
  getDetal: id => {
    return http.get(`${base.message}/base/noticeMsgManager/getDetail/${id}`)
  },
  // 列表
  getList: params => {
    return http.post(`${base.message}/base/noticeMsgManager/getList`, params)
  },

  //获取邮箱列表
  getEmailList: params => {
    return http.get(`${base.message}/exportEmail/page`, params)
  },

  //新建邮箱
  saveExportEmail: params => {
    return http.postJson(`${base.message}/exportEmail/add`, params)
  },

  //编辑邮箱
  updateExportEmail: params => {
    return http.postJson(`${base.message}/exportEmail/save`, params)
  },

  //获取邮箱详情
  getEmailInfo: params => {
    return http.get(`${base.message}/exportEmail/getById`, { params })
  },

  //删除邮箱
  deleteEmail: id => {
    return http.post(`${base.message}/exportEmail/delete/${id}`)
  },

  exportByEmail: params => {
    return http.get(`${base.message}/exportEmail/emails`, params)
  }
}

export default message
